import { createModalService } from './ModalService'
import ModalContainer from './ModalContainer.vue'

export default {
  install(app) {
    const modalService = createModalService()

    // 提供给组件注入使用
    app.provide('modalService', modalService)

    // 添加到全局属性
    app.config.globalProperties.$modal = modalService

    // 注册弹窗容器组件
    app.component('ModalContainer', ModalContainer)
  }
}